home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------//
-
- // Synopsis: Multiplicative sequence.
-
- // Syntax: Y = seqm ( A , B , N )
-
- // Description:
-
- // seqm(A,B,N) produces a row vector comprising N
- // logarithmically equally spaced numbers, starting at A ~= 0 and
- // finishing at B ~= 0. If A*B < 0 and N > 2 then complex results
- // are produced. If N is omitted then 10 points are generated.
-
- // This file is a translation of seqm.m from version 2.0 of
- // "The Test Matrix Toolbox for Matlab", described in Numerical
- // Analysis Report No. 237, December 1993, by N. J. Higham.
-
- //-------------------------------------------------------------------//
-
- seqm = function ( a , b , n )
- {
- if (!exist (n)) { n = 10; }
-
- if (n <= 1)
- {
- y = a;
- return y;
- }
-
- p = [0:n-2]/(n-1);
- r = (b/a).^p;
- y = [a*r, b];
-
- return y;
- };
-